using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using BA.DAL;
using Microsoft.VisualBasic;

namespace BlazeApps.Library.Forum
{
    public class CategoryList : Base
    {
        private BA.DAL.DBUtility DAL = new BA.DAL.DBUtility();
        private Procedures Procs = new Procedures();

        public DataTable GetCategories()
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            return DAL.GetDataTable(Procs.ListForumCategory.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetCategories(Guid CategoryID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@CategoryID", CategoryID);

            return DAL.GetDataTable(Procs.ListForumCategoryByCategoryID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetCategoriesByBoard(Guid BoardID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@BoardID", BoardID);

            return DAL.GetDataTable(Procs.ListForumCategoryByBoardID.ToString().Trim(), CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetBreadCrumbLinks(Guid CategoryID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@CategoryID", CategoryID);

            return DAL.GetDataTable(Procs.ListLinkDataForCategoryByCategoryID.ToString().Trim(), CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetCategorySelectionList()
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            return DAL.GetDataTable(Procs.ForumCategorySelectionList.ToString().Trim(), CommandType.Text, System.Data.ConnectionState.Open);
        }
    }
}
